<template>
  <view class="container">
    <view class="header_txt">
      <view class="back"
            @click="backHandler">
        <image src="/static/img/back3.png"></image>
      </view>
      <view class="title"> 我的钱包 </view>
    </view>
    <view class="content">
      <view class="input_list">
        <view class="title_list">
          <view class="line"></view>充值金额
        </view>
        <view class="input_box">
          <text style="font-size: 44rpx; margin-top: -25rpx; margin-right: 10rpx;">￥</text>
          <input type="number"
                 placeholder="请输入充值金额"
                 placeholder-class="input_class"
                 v-model='money' />
        </view>
      </view>
      <view class="list_box">
        <view class="title_list">
          <view class="line"></view>支付信息
        </view>
        <view class="list_item">
          <image class="list_icon"
                 src="../../static/image/ico_wx@2x.png"
                 mode=""></image>
          <view class="list_item_right">
            <view class="list_title">微信支付</view>
            <image src="../../static/image/ddjs_ico_xz_nor@2x.png"
                   mode=""
                   v-show="type!=1"
                   @click="chooseType(1)"></image>
            <image src="../../static/image/ddjs_ico_xz_sel@2x.png"
                   mode=""
                   v-show="type==1"></image>
          </view>
        </view>
        <view class="list_item">
          <image class="list_icon1"
                 src="../../static/image/ico_zfb@2x.png"
                 mode=""></image>
          <view class="list_item_right">
            <view class="list_title">支付宝支付</view>
            <image src="../../static/image/ddjs_ico_xz_sel@2x.png"
                   mode=""
                   v-show="type==2"></image>
            <image src="../../static/image/ddjs_ico_xz_nor@2x.png"
                   mode=""
                   v-show="type!=2"
                   @click="chooseType(2)"></image>

          </view>
        </view>
      </view>
      <view class="btn"
            @click='entruepay'>确认</view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      type: 1,
      money: ''
    }
  },
  onLoad() {},
  methods: {
    //zhang/wallet/recharge
    async entruepay() {
      const { data } = await this.$http.post('/zhang/wallet/recharge', { pay_type: this.type, money: this.money })
      console.log(data)
    },
    chooseType(type) {
      this.type = type
    },
    backHandler() {
      uni.navigateBack({
        delta: 1
      })
    }
  }
}
</script>

<style lang="scss">
/* 头部区域 */
.header_txt {
  width: 750rpx;
  overflow: hidden;
  height: 88rpx;
  line-height: 88rpx;
  background-color: #fff;

  .back {
    position: absolute;
    top: 14rpx;
    left: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    image {
      width: 48rpx;
      height: 48rpx;
    }
  }

  .right {
    position: absolute;
    top: 14rpx;
    right: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .title {
    text-align: center;
    height: 88rpx;
    // margin-top: -20rpx;
    // line-height: 88rpx;
    font-size: 32rpx;
    font-weight: bold;
  }
}
.content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
}
.title_list {
  width: 100%;
  height: 88rpx;
  padding: 0 30rpx;
  display: flex;
  align-items: center;
  font-size: 34rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
}
.input_list {
  width: 100%;
  height: 200rpx;
  background-color: #ffffff;
  margin-top: 20rpx;
  /* display: flex;
		align-items: center; */
}
.input_box {
  width: 86%;
  height: 100rpx;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  /* border-bottom: 1rpx solid #F5F5F5; */
}
.input_class {
  font-size: 28rpx;
  color: #999999;
}
.list_box {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  background-color: #ffffff;
  margin-top: 20rpx;
}
.list_item {
  width: 96%;
  height: 100rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1rpx solid #f5f5f5;
  margin-left: 30rpx;
}
.list_icon {
  width: 40rpx;
  height: 35rpx;
  margin-right: 20rpx;
}
.list_icon1 {
  width: 40rpx;
  height: 40rpx;
  margin-right: 20rpx;
}
.list_icon2 {
  width: 42rpx;
  height: 44rpx;
  margin-right: 20rpx;
}
.list_title {
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
}
.list_item_right {
  height: 100%;
  width: 90%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list_item_right image {
  width: 36rpx;
  height: 36rpx;
  margin-right: 20rpx;
}
.list_title {
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
}
.btn {
  width: 86%;
  height: 88rpx;
  background: #ffdd47;
  border-radius: 10rpx;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 80rpx;
  font-size: 30rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
  position: absolute;
  bottom: 3%;
  left: 6.7%;
}
.line {
  width: 4rpx;
  height: 20rpx;
  background: #ffdd47;
  border-radius: 2rpx;
  margin-right: 6rpx;
}
</style>
